#pragma once

#include <stdint.h>

class YuvConverter
{
public:
	YuvConverter();
	~YuvConverter();

	enum YUV_FMT {
		YV12,	//YYYYVU
		YU12	//YYYYUV
	};

	static int I420ToRGB24(
		const uint8_t* src_y, int src_stride_y,
		const uint8_t* src_u, int src_stride_u,
		const uint8_t* src_v, int src_stride_v,
		uint8_t* dst_buf, int dst_stride, int w, int h, YUV_FMT fmt = YV12);

	static int I420ToBGRA(
		const uint8_t* src_y, int src_stride_y,
		const uint8_t* src_u, int src_stride_u,
		const uint8_t* src_v, int src_stride_v,
		uint8_t* dst_buf, int dst_stride, int w, int h, YUV_FMT fmt = YV12);

	static int I420ToRGBA(
		const uint8_t* src_y, int src_stride_y,
		const uint8_t* src_u, int src_stride_u,
		const uint8_t* src_v, int src_stride_v,
		uint8_t* dst_buf, int dst_stride, int w, int h, YUV_FMT fmt = YV12);

	static int RGB24ToI420(
		const uint8_t* src_buf, int src_stride,
		uint8_t* dst_y, int dst_stride_y,
		uint8_t* dst_u, int dst_stride_u,
		uint8_t* dst_v, int dst_stride_v,
		int w, int h);
};

